package org.agilelang.editor;

/*
 AgileLang - A fourth generation language(http://www.agilelang.org).

 Copyright (C) 2013 Roderick Cusirramos (roderick20@hotmail.com)

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
import com.seaglasslookandfeel.SeaGlassLookAndFeel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import org.agilelang.editor.tool.I18n;
import org.agilelang.editor.tool.Log;

public class Editor {

    public static void main(String args[]) {
        try {
            java.awt.EventQueue.invokeLater(new Runnable() {
                @Override
                public void run() {                   

                    /*try {
                        UIManager.setLookAndFeel(new SeaGlassLookAndFeel());
                    } catch (UnsupportedLookAndFeelException e) {
                        e.printStackTrace();
                    }*/

                    I18n.init();
                    Log.Instance().info("org.agilelang.editor.Editor", "main", "Iniciando aplicacion");
                    final ViewFrame app = new ViewFrame();
                    SwingUtilities.invokeLater(new Runnable() {
                        @Override
                        public void run() {
                            app.requestFocus();
                            app.requestFocusInWindow();
                            //app.requestFocus(true);
                        }
                    });
                    app.setSize(500, 500);
                    app.setFocusable(true);
                    app.setExtendedState(ViewFrame.MAXIMIZED_BOTH);
                    app.setVisible(true);
                }
            });
        } catch (Exception ex) {
            Log.Instance().error("org.agilelang.editor.Editor", "main", ex.toString());
        }
    }
}